Along with the maturing of two-dimensional code information technologies, two-dimensional codes are gradually recognized and accepted by people. The two-dimensional code generally has advantages such as a large information capacity, a broad coding range, a strong fault-tolerant capability, a low manufacturing cost, and an automatic recognition, which is widely applied in various industries such as instant messaging, e-commerce, information promotion, and product anti-forgery.
Generally, the two-dimensional code may include a two-dimensional bar code and a two-dimensional matrix code, which may be symbol information that is distributed on a plane (a two-dimensional direction) by a particular geometry according to a certain rule and records data with a black and white graph. The two-dimensional code generally uses the concept of “0”, “1” bit streams that form an internal logic base of a computer in terms of code instrumentation, and expresses original information as two-dimensional data by using binary codes corresponding to the original information. The two-dimensional data may be converted into a corresponding two-dimensional code image by two-dimensional code generation software. For example, in a two-dimensional matrix code, a graph formed by a different distribution of black and white pixels in a rectangular two-dimensional plane may be used to express the two-dimensional data. The “1” in the binary data of the two-dimensional code may indicate that a pixel element shows up at a location in the rectangular two-dimensional plane, and may be indicated by a black square; the “0” in the binary data of the two-dimensional code may indicate that a pixel element does not show up at a location in the rectangular two-dimensional plane, and may be indicated by a white square. The two-dimensional code data may be expressed as a two-dimensional code graph formed by arranging and combining black and white squares of the rectangular two-dimensional plane.
In the process of using the two-dimensional code, in order to improve the security of the two-dimensional code data, the two-dimensional code data may be encrypted, and then a two-dimensional code graph may be generated with the encrypted two-dimensional code data. The commonly used two-dimensional code data encryption method may include encrypting two-dimensional code data by using a key, and generating a two-dimensional code graph with the key-encrypted two-dimensional code data. The two-dimensional code image may also include encrypted key information. Correspondingly, the receiver may decrypt the two-dimensional code data by using the key to acquire information before encryption. However, the key for encrypting two-dimensional code data is generally data information generated by a computing device according to a certain algorithm, and there are risks of being easily stolen, intercepted, broken, and the like by illegal users during the key storage or transmission. Once the key is acquired by the illegal users, the illegal users may crack or falsify the two-dimensional code data by using the stolen key, or give a fake or even malicious two-dimensional code data by using the key, which may cause a huge damage to the users. In the conventional techniques, there is still a risk of being acquired by the illegal users in terms of the key information for encrypting the two-dimensional code data, which reduces the security of the encrypted two-dimensional code data.